package org.jcurry;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * With the Eclipse runtime instrumented with <font
 * face="Cooper Black">jcurry</font>, annotating a field, method or constructor
 * with <code>AsFunction</code> causes the injection of a corresponding field implementing
 * <code>com.google.common.base.Function</code>.
 * <table border="1">
 * <tr>
 * <th>Element</th>
 * <th>Function From</th>
 * <th>Function To</th>
 * <th>Function Field Modifiers</th>
 * </tr>
 * <tr>
 * <td>No-arg instance method</td>
 * <td>Enclosing type</td>
 * <td>Return type</td>
 * <td>As method, plus <code>static</code></td>
 * </tr>
 * <tr>
 * <td>One or more-arg instance/static method</td>
 * <td>First argument</td>
 * <td>If no more arguments then return type, else function from next argument
 * to <i>this statement</i></td>
 * <td>As method</td>
 * </tr>
 * <tr>
 * <td>No-arg static method or constructor</td>
 * <td>Not allowed</td>
 * </tr>
 * <tr>
 * <tr>
 * <td>One or more-arg constructor</td>
 * <td>First argument</td>
 * <td>If no more arguments then enclosing type, else function from next
 * argument to <i>this statement</i></td>
 * <td>As constructor, plus <code>static</code></td>
 * </tr>
 * <tr>
 * <td>Instance field</td>
 * <td>Enclosing type</td>
 * <td>Field type</td>
 * <td>As field, plus <code>static</code></td>
 * </tr>
 * <tr>
 * <td>Static field</td>
 * <td>Not allowed</td>
 * </tr>
 * </table>
 */
@Target( { ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR })
@Retention(RetentionPolicy.SOURCE)
public @interface AsFunction
{
}
